﻿#ifndef NSSHARE_SYS_FILE_STREAM_DEFINE_H_
#define NSSHARE_SYS_FILE_STREAM_DEFINE_H_

#include "../platform.h"
#include "../utils/bitwise_enum.h"

namespace nsshare
{
namespace sys
{

namespace FileAccess
{
enum _Value
{
    kAll        = GENERIC_ALL,
    kExecute    = GENERIC_EXECUTE,
    kRead       = GENERIC_READ,
    kWrite      = GENERIC_WRITE,
    kReadWrite  = GENERIC_READ | GENERIC_WRITE,
};
typedef nsshare::utils::BitwiseEnum<_Value>  Value;
}

namespace FileMode
{
enum Value
{
    kCreateAlways   = CREATE_ALWAYS,
    kCreateNew      = CREATE_NEW,
    kOpen           = OPEN_EXISTING,
    kOpenOrCreate   = OPEN_ALWAYS,
    kTruncate       = TRUNCATE_EXISTING,
};
}

namespace FileShare
{
enum _Value
{
    kExclusive  = 0,
    kDelete     = FILE_SHARE_DELETE,
    kRead       = FILE_SHARE_READ,
    kWrite      = FILE_SHARE_WRITE,
};
typedef nsshare::utils::BitwiseEnum<_Value>  Value;
}

namespace FileOption
{
enum _Value
{
    kNone               = 0,
    kDeleteOnClose      = FILE_FLAG_DELETE_ON_CLOSE,
    kRandomAccess       = FILE_FLAG_RANDOM_ACCESS,
    kSequentialScan     = FILE_FLAG_SEQUENTIAL_SCAN,
    kWriteThrough       = FILE_FLAG_WRITE_THROUGH,
};
typedef nsshare::utils::BitwiseEnum<_Value>  Value;
}

namespace FileAttribute
{
enum _Value
{
    kNormal         = FILE_ATTRIBUTE_NORMAL,
    kHidden         = FILE_ATTRIBUTE_HIDDEN,
    kReadOnly       = FILE_ATTRIBUTE_READONLY,
    kSystem         = FILE_ATTRIBUTE_SYSTEM,
    kTemporary      = FILE_ATTRIBUTE_SYSTEM,
    kArchive        = FILE_ATTRIBUTE_ARCHIVE,
};
typedef nsshare::utils::BitwiseEnum<_Value>  Value;
}

namespace FilePosition
{
enum Value
{
    kBegin      = FILE_BEGIN,
    kCurrent    = FILE_CURRENT,
    kEnd        = FILE_END,
};
}

namespace FileLockMode
{
enum _Value
{
    kExclusiveLock = LOCKFILE_EXCLUSIVE_LOCK,
    kFailImmediately = LOCKFILE_FAIL_IMMEDIATELY,
};
typedef nsshare::utils::BitwiseEnum<_Value> Value;
}

}

}

#endif NSSHARE_SYS_FILE_STREAM_DEFINE_H_